﻿using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;

public class NotifyUser : TJLogger
{
    private static string Message = "扎心了老铁:您已经好久没超越自己了，赶快回来玩一局吧！";
    
	//本地推送消息 (单位: 秒)
	private const int notifyTime = 2 * 24 * 60 * 60;

    public void RegisterNotification ()
    {

        #if UNITY_EDITOR
        return;
        #elif UNITY_IPHONE
		TJLog("开启本地推送");
		registerLocalNotification(notifyTime, Message);
        #endif
    }

    public void CancelNotification ()
    {
        #if UNITY_EDITOR
        return;
        #elif UNITY_IPHONE
		TJLog("取消本地推送");
        cancelLocalNotification();
        #endif
    }


    [DllImport("__Internal")]
    static extern void registerLocalNotification (int notifyTime , string message);

    [DllImport("__Internal")]
    static extern void cancelLocalNotification ();
}
